GPX: Read archived/active state from Pocket Queries.
authorrobertl <robertl>
Mon, 3 Sep 2007 22:42:28 +0000 (22:42 +0000)
committerrobertl <robertl>
Mon, 3 Sep 2007 22:42:28 +0000 (22:42 +0000)
KML: Read track name.

defs.h
gpx.c
kml.c

diff --git a/defs.h b/defs.h
index 0a29c5443fcfcb83ecea255aa9e239badfab11ab..47bd4b2fe06237df9cd1ff7ffc4919f3f035aa33 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -233,6 +233,8 @@ typedef struct {
        geocache_container container:4;
        unsigned int diff:6; /* (multiplied by ten internally) */
        unsigned int terr:6; /* (likewise) */
+       unsigned int is_archived:1;
+       unsigned int is_available:1;
        time_t exported;
        time_t last_found;
        char *placer; /* Placer name */
diff --git a/gpx.c b/gpx.c
index 7e9bc32320cad6a777cc44f8a55cb354d05bf8e2..cd7ed9f050c2ec4ccc9f4a1928fd5aecbba772ec 100644 (file)
--- a/gpx.c
+++ b/gpx.c
@@ -480,6 +480,14 @@ tag_gs_cache(const char **attrv)
        for (avp = &attrv[0]; *avp; avp+=2) {
                if (strcmp(avp[0], "id") == 0) {
                                wpt_tmp->gc_data.id = atoi(avp[1]);
+               } else if (strcmp(avp[0], "available") == 0) {
+                       if (strcmp(avp[1], "True") == 0) {
+                               wpt_tmp->gc_data.is_available = 1;
+                       }
+               } else if (strcmp(avp[0], "archived") == 0) {
+                       if (strcmp(avp[1], "True") == 0) {
+                               wpt_tmp->gc_data.is_archived = 1;
+                       }
                }
        }
 }
diff --git a/kml.c b/kml.c
index 90cc9b671cc1bea81395f7ceabe07ecb74e429ac..62e33962464dbb1b63dbc24f42898fcf91e0fab4 100644 (file)
--- a/kml.c
+++ b/kml.c
@@ -208,6 +208,9 @@ void trk_coord(const char *args, const char **attrv)
        waypoint *trkpt;
 
        route_head *trk_head = route_head_alloc();
+       if (wpt_tmp->shortname) {
+               trk_head->rte_name  = xstrdup(wpt_tmp->shortname);
+       }
        track_add_head(trk_head);
        
        while (3 == sscanf(args,"%lf,%lf,%lf %n", &lon, &lat, &alt, &consumed)){